{extend name="base"/}
{block name="meta"}
 <title>b2b2c开源商城-b2b2c多商户系统-b2b2c系统开发-Niushop开源商城</title>
  <meta name="description" content="Niushop开源商城系统为多商户B2B2C、b2b2c开源商城、b2b2c多商户系统、b2b2c系统开发公司提供开源商城平台，支持二次开发定制！咨询热线：400-886-7993" />
  <meta name="keywords" content="多商户B2B2C,b2b2c开源商城,多商户B2B2C公司,b2b2c多商户系统,b2b2c系统开发,b2b2c开源商城系统" />
{/block}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="INDEX_CSS/price.css"/>
{/block}
{block name="main"}
<div class="ns-banner">
	<img src="INDEX_IMG/banner.png" />
	
	<div class="ns-banner-desc">
		<h1>轻松开启小程序店铺</h1>
		<h4>免费 / 安全 / 专业 / 便捷</h4>
		<a href="javascript:freeOpenShop()" class="layui-btn ns-bg-color">免费开店</a>
	</div>
</div>
<!-- 标题 -->
<div class="ns-content-title">
	<h2>专业的小程序开店工具</h2>
	<h4 class="ns-font-color">专业 / 高效 / 便捷 / 省心</h4>
</div>
<!-- 内容 -->
<div class="ns-content">
	<div class="ns-content-box">
		<!-- 套餐列表 -->
		<div class="ns-setmeal">
			{foreach name="$addon_list" item="addon_list_v" key="k"}
			<div class="ns-setmeal-item">
				
				<div class="ns-setmeal-title">{$addon_list_v.group_name}</div>
				<div class="ns-setmeal-desc">{$addon_list_v.desc?$addon_list_v.desc:''}</div>
				<div class="ns-setmeal-info">
					<div class="ns-setmeal-info_title">营销应用:</div>
					<ul class="ns-setmeal-info_content" >
						{foreach $addon_list_v.exist_addon_list as $exist}
						<li><span class="ns-text-color"><img src="INDEX_IMG/duigou.png"></span>{$exist}</li>
						{/foreach}

						{foreach $addon_list_v.noexist_addon_list as $noexist}
						<li><span class="ns-text-color"><img src="INDEX_IMG/cha.png" style="width:10px"></span>{$noexist}</li>
						{/foreach}
					</ul>
				</div>
				<div class="arow arow_down" data-index="{$k}" data-height="{$addon_list_v.exist_addon_list | count}" data-height_no="{$addon_list_v.noexist_addon_list | count}"><img src="INDEX_IMG/bottom_jiantou.png"/></div>
				<div class="ns-setmeal_price">￥{$addon_list_v.fee}/{if $addon_list_v.unit == 'week'} 周 {elseif $addon_list_v.unit == 'month'} 月 {elseif $addon_list_v.unit == 'year'} 年 {/if}</div>
			</div>
			{/foreach}

		</div>
		
	</div>
</div>

{/block}
{block name="script"}
<script id="openShop" type="text/html">
	<div class="free-open-shop">
		<span>请联系官方客服，联系方式如下：</span>
		{if $website_info.web_phone}
		<span>电话联系：{$website_info.web_phone}</span>
		{/if}
		{if $website_info.web_qq}
		<span> QQ联系：{$website_info.web_qq}</span>
		{/if}
		{if $website_info.web_weixin}
		<span>微信联系：{$website_info.web_weixin}</span>
		{/if}
		{if $website_info.web_email}
		<span>邮箱联系：{$website_info.web_email}</span>
		{/if}
	</div>
</script>
<script type="text/javascript">
	$(document).on("click",'.arow_down',function(){
		var index = $(this).data('index'),index_p=0,index_n=0;

		if(index % 3 == 0){
			var temp = index;
			index_p = temp;
			index = temp+1;
			index_n = temp+2
		}else if(index % 3 == 1){
			var temp = index;
			index = temp;
			index_p = temp-1;
			index_n = temp + 1
		}
		else if(index % 3 == 2){
			var temp = index;
			index_p = temp-2;
			index = temp-1;
			index_n = temp;
		}

		var index_p_height = $('.ns-setmeal-item:eq('+index_p+')').children('.arow_down').data('height') +$('.ns-setmeal-item:eq('+index_p+')').children('.arow_down').data('height_no');
		var index_height = $('.ns-setmeal-item:eq('+index+')').children('.arow_down').data('height') +$('.ns-setmeal-item:eq('+index+')').children('.arow_down').data('height_no');
		var index_n_height = $('.ns-setmeal-item:eq('+index_n+')').children('.arow_down').data('height') +$('.ns-setmeal-item:eq('+index_n+')').children('.arow_down').data('height_no');

		var max = index_p_height > index_height ? index_p_height : index_height;
		max = max > index_n_height ? max : index_n_height;
		 var height = max*20;
		$('.ns-setmeal-item:eq('+index_p+')').children('.ns-setmeal-info').children('ul').css('height',height+'px');
		$('.ns-setmeal-item:eq('+index+')').children('.ns-setmeal-info').children('ul').css('height',height+'px');
		$('.ns-setmeal-item:eq('+index_n+')').children('.ns-setmeal-info').children('ul').css('height',height+'px');

		$('.ns-setmeal-item:eq('+index_p+')').children('.arow_down').children('img').css('transform','rotate(90deg)');
		$('.ns-setmeal-item:eq('+index+')').children('.arow_down').children('img').css('transform','rotate(90deg)');
		$('.ns-setmeal-item:eq('+index_n+')').children('.arow_down').children('img').css('transform','rotate(90deg)');

		$('.ns-setmeal-item:eq('+index_p+')').children('.arow_down').addClass('arow_up').removeClass('arow_down');
		$('.ns-setmeal-item:eq('+index+')').children('.arow_down').addClass('arow_up').removeClass('arow_down');
		$('.ns-setmeal-item:eq('+index_n+')').children('.arow_down').addClass('arow_up').removeClass('arow_down');

		$('.ns-setmeal-item:lt('+index_p+')').children('.ns-setmeal-info').children('ul').css('height','82px');
		$('.ns-setmeal-item:gt('+index_n+')').children('.ns-setmeal-info').children('ul').css('height','82px');
	});
	$(document).on("click",'.arow_up',function(){
		var index = $(this).data('index'),index_p=0,index_n=0;

		if(index % 3 == 0){
			var temp = index;
			index_p = temp;
			index = temp+1;
			index_n = temp+2;
		}else if(index % 3 == 1){
			var temp = index;
			index = temp;
			index_p = temp-1;
			index_n = temp + 1
		}
		else if(index % 3 == 2){
			var temp = index;
			index_p = temp-2;
			index = temp-1;
			index_n = temp;
		}
		$('.ns-setmeal-item:eq('+index_p+')').children('.ns-setmeal-info').children('ul').css('height','82px');
		$('.ns-setmeal-item:eq('+index+')').children('.ns-setmeal-info').children('ul').css('height','82px');
		$('.ns-setmeal-item:eq('+index_n+')').children('.ns-setmeal-info').children('ul').css('height','82px');
		
		$('.ns-setmeal-item:eq('+index_p+')').children('.arow_up').children('img').css('transform','rotate(-90deg)');
		$('.ns-setmeal-item:eq('+index+')').children('.arow_up').children('img').css('transform','rotate(-90deg)');
		$('.ns-setmeal-item:eq('+index_n+')').children('.arow_up').children('img').css('transform','rotate(-90deg)');

		$('.ns-setmeal-item:eq('+index_p+')').children('.arow_up').addClass('arow_down').removeClass('arow_up');
		$('.ns-setmeal-item:eq('+index+')').children('.arow_up').addClass('arow_down').removeClass('arow_up');
		$('.ns-setmeal-item:eq('+index_n+')').children('.arow_up').addClass('arow_down').removeClass('arow_up');

	});

	var businessType = "{$business_type}";

	//免费开店
	function freeOpenShop(){
		if(businessType == 3){
			location.href = ns.url("home/index/index");
		}else{
			layer.open({
				type: 1,
				title: "免费开店",
				content: $("#openShop").html(),
				area: ['450px', 'auto']
			});
		}
	}

	//选择套餐
	$(".ns-setmeal_price").click(function () {
		if(businessType == 3){
			location.href = ns.url("home/sysusergroup/index");
		}else{
			layer.open({
				type: 1,
				title: "购买套餐",
				content: $("#openShop").html(),
				area: ['450px', 'auto']
			});
		}
	});
</script>
{/block}